<?php $bb_case=$this->inbound_warehouse_group_code=='BB';?>
<?php $is_tmp = ((string)$this->tmp == 1) ;?>
<?php $mod_name = $is_tmp ? 'tmp-inbound' : 'inbound' ;?>
<?php $con_name = 'index' ;?>
<?php $act_name = $is_tmp ? 'insert' : ( (string)$this->inbound_type == '1' ? 'insert-out' : 'insert-in' ) ;?>
<?php $inbound_type = $is_tmp ? NULl : $this->inbound_type ;?>
<?php $report_type = $is_tmp ? NULL : 0 ;?>

<style type="text/css">
dl.zend_form #inbound_note { height: 150px; resize:none }
</style>

<!-- thanh toolbar -->
<?php $act = (string)$this->inbound_type == '1' ? 'insert-out' : 'insert-in' ;?>
<?php $this->placeholder('toolbar')->captureStart();?>
	<?php //echo $this->partial('index/toolbar/icon.phtml', 'admin', array('label'=>'Xem log','class'=>'icon-32-module','onclick'=>"window.location='".$this->url(array('module'=>$mod_name,'action'=>"print",'controller'=>'index', 'id'=>$this->inbound_id), null, true)."'"));?>
	<?php echo $this->partial('index/toolbar/icon.phtml', 'admin', array('label'=>'Cập nhật','class'=>'icon-32-edit','onclick'=>"window.location='".$this->url(array('module'=>$mod_name,'action'=>'update','controller'=>'index', 'id'=>$this->inbound_id), null, true)."'"));?>
	<?php echo $this->partial('index/toolbar/divider.phtml', 'admin') ?>
	<?php echo $this->partial('index/toolbar/icon.phtml', 'admin', array('label'=>'In phiếu','class'=>'icon-32-print','onclick'=>"window.open('".$this->url(array('module'=>$mod_name,'action'=>"print",'controller'=>'index', 'id'=>$this->inbound_id), null, true)."', '_blank')"));?>	
	<?php if (!$is_tmp): ?>
		<?php echo $this->partial('index/toolbar/icon.phtml', 'admin', array('label'=>'Báo cáo nhanh','class'=>'icon-32-featured','onclick'=>"window.location='".$this->url(array('module'=>$mod_name,'action'=>"index",'controller'=>'index', 'inbound_type'=>$this->inbound_type, 'inbound_warehouse_group_code'=>$this->inbound_warehouse_group_code, "report_type"=>1), null, true) . "'"));?>
	<?php endif ;?>
	<?php echo $this->partial('index/toolbar/divider.phtml', 'admin') ?>
	<?php echo $this->partial('index/toolbar/icon.phtml', 'admin', array('label'=>'Sao chép phiếu','class'=>'icon-32-copy','onclick'=>"window.location='" . $this->url(array('module'=>$mod_name,'action'=>"copy",'controller'=>'index', 'id'=>$this->inbound_id), null, true) . "'"));?>
	<?php echo $this->partial('index/toolbar/new.phtml', 'admin', array($this->url(array('module'=>$mod_name,'action'=>$act_name,'controller'=>'index', 'inbound_warehouse_group_code'=>$this->inbound_warehouse_group_code, 'inbound_type'=>$inbound_type, "report_type"=>$report_type), null, true)));?>
	<?php echo $this->partial('index/toolbar/divider.phtml', 'admin') ?>
	<?php echo $this->partial('index/toolbar/cancel.phtml', 'admin', array($this->url(array('module'=>$mod_name,'action'=>'index','controller'=>'index','inbound_type'=>$inbound_type,'inbound_warehouse_group_code'=>$this->inbound_warehouse_group_code, "report_type"=>$report_type),null,true))); ?>
<?php $this->placeholder('toolbar')->captureEnd();?> 

<!-- / -->

<!-- nội dung form -->
<form method="post" action="" enctype="application/x-www-form-urlencoded" id="adminForm">
	<dl class="zend_form">
		<div class='col'>
			<fieldset id='fieldset_0'>
				<legend>Thông tin chung của phiếu</legend>
				<?php echo $this->form->inbound_id;?>
				<?php echo $this->form->adminAction;?>
				<?php echo $this->form->inbound_type;?>
				<?php echo $this->form->inbound_code;?>
				<?php echo $this->form->inbound_create_time?>
				<?php echo $this->form->inbound_create_user;?>				
			</fieldset>
		</div>
		<div class='col'>
			<fieldset id='fieldset_1'>
				<legend>Thông tin <?php echo $this->string_inbound_type?> kho</legend>
				<?php //echo $this->form->inbound_warehouse_code;?> 
				<?php //echo $this->form->inbound_warehouse_keep_user;?> 
				<?php //echo $this->form->inbound_reason_code;?> 
				<?php echo $this->form->inbound_order_code;?>
				<?php echo $this->form->inbound_note;?>
			</fieldset>
			<?php if($this->inbound_type==1){?>
			<fieldset id='fieldset_3'>
				<legend>Thông tin <?php echo $this->string_inbound_type_2?> hàng</legend>
				<?php if($this->reason_use_company==1){?>
				<?php echo $this->form->inbound_company_code;?>
				<?php }?>
				<?php echo $this->form->inbound_delivery_user;?>
			</fieldset>
			<?php }?>
		</div>
		
		<!-- THONG TIN CHI TIET -->
		<div class='full'>
			<fieldset id='fieldset_2'>
				<legend>Thông tin chi tiết của phiếu <?php echo $this->string_inbound_type?> kho</legend>
				<table width="100%" border="0" cellspacing="0" cellpadding="5" class="adminlist" id="table_inbound_detail">
					<thead>
						<tr>
							<th width='20px'>STT</th>							
							<th width='70px'>Mã <?php echo $this->inbound_warehouse_group_code?></th>
							<th >Tên <?php echo $this->inbound_warehouse_group_code?></th>
							<th width='90px'>ĐVT</th>
							<th width='70px'>Số lượng</th>
							<!--<th width='110px'>Vị trí lưu kho</th>-->
							<?php /*if(!$bb_case){?>
							<th width='70px'>Ngày SX</th>
							<th width='70px'>Ngày HH</th>
							<?php }*/?>
							<?php /*if($this->inbound_type==1 && ($this->inbound_warehouse_group_code=='NVL' || $this->inbound_warehouse_group_code=='BB')) {?>
							<th width='150px'>Thành phẩm</th>
							<?php }*/?>
							<!--<th width='110px'>Mã lot</th>-->
							<th>Ghi chú</th>
						</tr>
					</thead>
					<tbody>
						<?php $no=1;foreach ($this->inbound_details as $inbound_detail){?>
						<tr>
							<td class='center'><?php echo $no++;?></td>							
							<td class='left'><?php echo $inbound_detail->inbound_detail_product_code;?></td>
							<td class='left'><?php echo $inbound_detail->m_Array['product_name']?></td>
							<td class='center'><?php echo $inbound_detail->m_Array['unit_name']?></td>
							<td class='right'><?php echo $this->partial("index/format/float.phtml",'admin',array($inbound_detail->inbound_detail_product_quantity))?></td>
							<!--<td class='right'><?php //echo $inbound_detail->m_Array['location_name']?></td>-->
							<?php /*if(!$bb_case){?>
							<td class='center'><?php echo $this->partial("index/format/time.phtml",'admin',array($inbound_detail->inbound_detail_product_time))?></td>
							<td class='center'><?php echo $this->partial("index/format/time.phtml",'admin',array($inbound_detail->inbound_detail_expire_time))?></td>
							<?php }*/?>
							<?php /*if($this->inbound_type==1 && ($this->inbound_warehouse_group_code=='NVL' || $this->inbound_warehouse_group_code=='BB')) {?>
							<td class='left'><?php echo $inbound_detail->inbound_detail_sub_product_code." - ".$inbound_detail->m_Array['sub_product_name']?></td>
							<?php }*/ ?>
							<!--<td class='center'><?php echo $inbound_detail->inbound_detail_lot_code?></td>-->
							<td class='left'><?php echo $inbound_detail->inbound_detail_note?></td>
						</tr>
						<?php }?>
					</tbody>
				</table>
			</fieldset>
		</div>
		<!-- end.THONG TIN CHI TIET -->
	</dl>
</form>
<!-- / -->